﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CodeCamp.Models.Sponsors.SponsorsListViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Html.Encode( Model.EventDisplayName ) %> Sponsors
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
      Become a sponsor of Portland Code Camp 2012!
      Please view our <a href="http://www.portlandcodecamp.org/Content/2012/PortlandCodeCamp2012Sponsorship.pdf" target="_top">sponsorship opportunities</a> (PDF) for complete details.
    </p>

  <h1  class="title">Community Sponsors</h1>
  <div>
    <div class="communitySponsorsLeft">
      <ul>
        <%  int index = 0;
            int firstColumnCount = (int) Math.Floor( (Model.CommunitySponsors.Count + 1) / 2.0 );
            while ( index < firstColumnCount )
            { 
              var communitySponsor = Model.CommunitySponsors[ index++ ]; %>
              <li><a href="<%= Html.Encode( communitySponsor.Url ) %>"><%= Html.Encode( communitySponsor.Name ) %></a></li>
         <% } %>
      </ul>
    </div>    
    <div class="communitySponsorsRight">
      <ul>
        <% while ( index < Model.CommunitySponsors.Count ) 
           { 
             var communitySponsor = Model.CommunitySponsors[ index++ ]; %>
             <li><a href="<%= Html.Encode( communitySponsor.Url ) %>"><%= Html.Encode( communitySponsor.Name ) %></a></li>
        <% } %>
      </ul>
    </div>
    <div class="clear"></div>
  </div>

  <h1  class="title">Individual Contributors</h1>
  <div>
    <div class="communitySponsorsLeft">
      <% if ( Model.IndividualContributors.Count > 0 )
         { %>
            <ul>
              <% foreach ( var individualContributor in Model.IndividualContributors )
                 { %>
                    <li><%= Html.Encode( individualContributor.Name )%></li>
              <% } %>
            </ul>
     <% } 
        else
        { %>
          <i>Become an <a href="https://www.paypal.com/cgi-bin/webscr">individual contributor</a> today!</i>
     <% } %>
    </div>
    <div class="clear"></div>
  </div>

  <h1 class="title">Sponsors</h1>
  <div class="twoColumn">
    <div class="twoColumnLeft">
    <% index = 0; 
      foreach ( var sponsor in Model.Sponsors )
       {
          if ( index++ % 2 != 0 ) continue;
        %>
        <a href="<%= Html.Encode( sponsor.Url ) %>">
        <img src="<%= Html.Encode( sponsor.ImageUrl ) %>" 
             alt="<%= Html.Encode( sponsor.Name ) %>" 
             width="<%= Html.Encode( sponsor.ImageWidth ) %>"
             height="<%= Html.Encode( sponsor.ImageHeight ) %>"
             border="0" />
          </a><br />
    <% } %>
    </div>
    <div class="twoColumnRight">
    <% index = 0; 
      foreach ( var sponsor in Model.Sponsors )
       {
          if ( index++ % 2 != 1 ) continue;
        %>
        <a href="<%= Html.Encode( sponsor.Url ) %>">
        <img src="<%= Html.Encode( sponsor.ImageUrl ) %>" 
             alt="<%= Html.Encode( sponsor.Name ) %>" 
             width="<%= Html.Encode( sponsor.ImageWidth ) %>"
             height="<%= Html.Encode( sponsor.ImageHeight ) %>"
             border="0" />
          </a><br />
    <% } %>
    </div>
    <div class="clear"></div>
  </div>

</asp:Content>
